import React, { Component } from "react";
import Modal from 'bee-modal';
import 'bee-modal/build/Modal.css';
import { Button, Checkbox, Radio, Icon, InputGroup, FormControl, Tree } from "tinper-bee";
import selfNaxios from 'utils/ajaxConfig.js';
import { vendorsDanger } from 'utils/config.js';
import './index.less'

class CustomerReferContainer extends Component {
    constructor(props) {
        super(props);
        this.state = {
        }
        this.dataMap = new Map();
    }
    componentDidUpdate(prevProps, prevState, snapshot) {
    }


    sureClick = () => {
        this.props.getSelected(this.props.attrcode, this.value);
        this.props.closeRefer();
    }

    render() {
        let {
            isMultiSelectedEnabled,
            isShow = false,
            closeRefer,
            label,
            refPk,
            filterColumn,
            render,
            selected,
        } = this.props;
        return (
            <div>
                <Modal className='ygc-tree-refer' show={isShow} size={'lg'} onHide={closeRefer} backdrop={false}>
                    <Modal.Header closeButton>
                        <Modal.Title > {label} </Modal.Title>
                    </Modal.Header >
                    <Modal.Body>
                        {render && render.call(this, selected)}
                    </Modal.Body>
                    <Modal.Footer>
                        <div className="refer-btn-group">
                            <Button className='icon-cancel-btn' onClick={closeRefer}> 取消 </Button>
                            <Button colors="primary" onClick={this.sureClick}> 确认 </Button>
                        </div>
                    </Modal.Footer>
                </Modal>
            </div>
        )
    }
}


export default CustomerReferContainer;